
// 佩戴装备 {"道具":10,"类型":"道具","角色":"主角"}


// @ts-ignore
export async function execute(client_id,message_json) {
   let login_characters = G.Characters.get_current_login_characters(client_id);
   let type_key = message_json["类型"];
   let index = message_json["道具"]
   let target = message_json["角色"]
    if(index === undefined || index-1 < 0){
        ClientUtils.send_basic_prompt(client_id,"#R数据非法");
        return;
     }
     index = index-1;
     
     let items = login_characters[type_key];
     if(items === undefined){
        ClientUtils.send_basic_prompt(client_id,"#R数据非法");
        return;
     }
     let item = items[index];
     if(item === undefined || item === 0){
        ClientUtils.send_basic_prompt(client_id,"#R背包内不存在该物品");
        return;
     }
     if(target === "主角"){
        return G.Characters.wear_equipment(login_characters["id"],type_key,index);
     }
}